package com.nbsaas.boot.cms.rest.resource;

import com.nbsaas.boot.cms.api.apis.ArticleTagApi;
import com.nbsaas.boot.cms.data.entity.ArticleTag;
import com.nbsaas.boot.cms.api.domain.request.ArticleTagRequest;
import com.nbsaas.boot.cms.api.domain.response.ArticleTagResponse;
import com.nbsaas.boot.cms.api.domain.simple.ArticleTagSimple;
import com.nbsaas.boot.cms.rest.convert.ArticleTagSimpleConvert;
import com.nbsaas.boot.cms.rest.convert.ArticleTagEntityConvert;
import com.nbsaas.boot.cms.rest.convert.ArticleTagResponseConvert;
import com.nbsaas.boot.cms.data.repository.ArticleTagRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import jakarta.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   文章标签-业务接口实现
*/
@Transactional
@Service
public class ArticleTagResource extends BaseResource<ArticleTag,ArticleTagResponse, ArticleTagSimple, ArticleTagRequest>  implements ArticleTagApi {

    @Resource
    private ArticleTagRepository articleTagRepository;

    @Override
    public JpaRepositoryImplementation<ArticleTag, Serializable> getJpaRepository() {
        return articleTagRepository;
    }

    @Override
    public Function<ArticleTag, ArticleTagSimple> getConvertSimple() {
        return new ArticleTagSimpleConvert();
    }

    @Override
    public Function<ArticleTagRequest, ArticleTag> getConvertForm() {
        return new ArticleTagEntityConvert();
    }

    @Override
    public Function<ArticleTag, ArticleTagResponse> getConvertResponse() {
        return new ArticleTagResponseConvert();
    }




}


